import { Chart, Line, Axis, Interval, Legend, Tooltip } from "@antv/f2";
import { jsx as _jsx } from "@antv/f2/jsx-runtime";
import { jsxs as _jsxs } from "@antv/f2/jsx-runtime";

// interface Props {
//   data: any[];
//   field: string;
// }

// export function inChart(props){
//   const {data} = props;
//   return _jsxs(Chart, {
//     data: data,
//     children: [_jsx(Axis, {
//       field: "x"
//     }), _jsx(Axis, {
//       field: "y"
//     }), _jsx(Interval, {
//       x: "x",
//       y: "y",
//       color: "x",
//     }),_jsx(Legend,{
//       position:"top"
//     })]
//   });
// };

export const chartData = [
  {
    name: "长津湖",
    percent: 0.4,
    a: "1",
  },
  {
    name: "我和我的父辈",
    percent: 0.2,
    a: "1",
  },
  {
    name: "失控玩家",
    percent: 0.18,
    a: "1",
  },
  {
    name: "宝可梦",
    percent: 0.15,
    a: "1",
  },
  {
    name: "峰爆",
    percent: 0.05,
    a: "1",
  },
  {
    name: "其他",
    percent: 0.02,
    a: "1",
  },
];

export const inChart = (props) => {
  const { data } = props;
  return _jsxs(Chart, {
    data: data,
    coord: {
      transposed: true,
      type: "polar",
    },
    children: [
      _jsx(Interval, {
        x: "a",
        y: "percent",
        color: {
          field: "name",
          range: [
            "#1890FF",
            "#13C2C2",
            "#2FC25B",
            "#FACC14",
            "#F04864",
            "#8543E0",
          ],
        },
      }),
      _jsx(Legend, {
        position: "right",
      }),
      _jsx(Tooltip),
    ],
  });
};
module.exports = {};
